<?php
class SupplierCategoryParser{

	public static function Instance(){
		return new SupplierCategoryParser();
	}

	public static function parseSupplierCategoryResultToXml($result){
		$result_array = array();
		foreach ($result as $item){
			$itemArray['SuppierCategoryId'] = $item->id;
			$itemArray['SuppierCategoryName'] = $item->name;
			$entity = new Entity();
			$entity->entityName = "SuppierCategory";
			$entity->entityValue = $itemArray;
			array_push($result_array, $entity);
		}
		$entity = new Entity();
		$entity->entityName = "SuppierCategories";
		$entity->entityValue = $result_array;
		$xml = XmlUtil::Factory()->entityToXml($entity,0,0);
		return $xml;
	}
}